package com.cacshanghai.cac_oa_client.ui;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ListView;
import android.widget.TextView;

import com.cacshanghai.cac_oa_client.R;

/**
 * Created by geyh on 2016/5/30.
 */
public class FromUserDailyFragment extends Fragment {

    private ListView listView;
    private ConditionAdapter conditionAdapter;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        return inflater.inflate(R.layout.fragment_condition_daily_approval, null);
    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        listView = (ListView) getView().findViewById(R.id.lv_daily);
        conditionAdapter = new ConditionAdapter();
        listView.setAdapter(conditionAdapter);
    }

    class ConditionAdapter extends BaseAdapter {

        @Override
        public int getCount() {
            return 1;
        }

        @Override
        public Object getItem(int position) {
            return null;
        }

        @Override
        public long getItemId(int position) {
            return position;
        }

        @Override
        public View getView(int position, View convertView, ViewGroup parent) {
            if (convertView == null) {
                convertView = LayoutInflater.from(getContext()).inflate(R.layout.item_condition_daily_approval, null);
            }

            TextView tv_condition = (TextView) convertView.findViewById(R.id.tv_condition);
            tv_condition.setText("葛仪豪");

            return convertView;
        }
    }

}
